package pro.shushi.pamirs.hr.api.enums;

import pro.shushi.pamirs.meta.annotation.Dict;
import pro.shushi.pamirs.meta.common.enmu.IEnum;

@Dict(dictionary = HrEmployeeStatusEnum.dictionary, displayName = "员工状态", summary = "员工状态")
public enum HrEmployeeStatusEnum implements IEnum<Integer> {

    TRUN(1, "试用期", "试用期"),
    ENTRY(2, "已转正", "已转正"),
    QUITTED(3, "离职", "离职"),
    ;

    public static final String dictionary = "hr.simple.HrEmployeeStatusEnum";

    private final Integer value;
    private final String displayName;
    private final String help;

    HrEmployeeStatusEnum(Integer value, String displayName, String help) {
        this.value = value;
        this.displayName = displayName;
        this.help = help;
    }

    public static HrEmployeeStatusEnum fetchByValue(Integer value){
        for (HrEmployeeStatusEnum hrEmployeeStatusEnum : HrEmployeeStatusEnum.values()) {
            if(hrEmployeeStatusEnum.value.equals(value)){
                return hrEmployeeStatusEnum;
            }
        }
        return null;
    }

    @Override
    public Integer value() {
        return value;
    }

    @Override
    public String displayName() {
        return displayName;
    }

    @Override
    public String help() {
        return help;
    }
}
